package com.chenxin.wms.service.impl;

import com.chenxin.wms.domain.StockEntity;
import com.chenxin.wms.domain.vo.StockVO;
import com.chenxin.wms.mapper.StockMapper;
import com.chenxin.wms.service.IStockService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 库存查询Service业务层处理
 *
 * @author gry
 * @date 2025-04-10
 */
@Service
@Slf4j
public class StockServiceImpl implements IStockService {
    @Autowired
    private StockMapper stockMapper;
    /**
     * 查询库存查询
     *
     * @param stockId 库存查询主键
     * @return 库存查询
     */
    @Override
    public StockEntity selectStockByStockId(Long stockId) {
        return stockMapper.selectById(stockId);
    }

    /**
     * 查询库存查询列表
     *
     * @param stockVo 库存查询
     * @return 库存查询
     */
    @Override
    public List<StockVO> selectStockList(StockVO stockVo) {
        return stockMapper.selectStockViewList(stockVo);
    }

    @Override
    public List<StockVO> selectStockBySpuNo(String spuNo) {
        return stockMapper.selectStockListBySpuNo(spuNo);
    }

    /**
     * 盘点查询库存查询列表
     *
     * @param stockVo 库存查询
     * @return 库存查询集合
     */
    @Override
    public List<StockVO> checkStockList(StockVO stockVo) {
        return stockMapper.selectCheckStockList(stockVo);
    }
}
